type Tdom_options = {
    attributes?: Tdom_attr_obj,
    styles?: Tdom_style_obj
};

interface _CD_ {
    /**
     * 创建元素
     * @param tagName 标签名 'div' or '<div>'
     * @param options 参数
     * @returns 元素
     */
    createElement(tagName: string, options?: Tdom_options): KHTMLElement;
}
{
    Object.defineProperty(_CD_.prototype, 'createElement', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: (tagName: string, options?: Tdom_options) => {
            if (U.R.tagName.test(tagName)) { tagName = tagName.slice(1, -1); }

            const ele = new KHTMLElement(document.createElement(tagName));
            if (options) {
                if (options.attributes) { ele.setAttr(options.attributes); }
                if (options.styles) { ele.setStyle(options.styles); }
            }
            return ele;
        }
    });
}
